package sjtu.rfid.rri.services.tds.pattern;

/**
 * This interface defines the operations of Pattern factory which is used to
 * create EPC tag patterns.
 * 
 * @author jinghao
 * 
 */
public interface PatternFactory {
	/**
	 * Equivalent to calling <code>newInstance(String uri, false)</code>.
	 * 
	 * @param uri
	 *            A properly formatted EPC pattern. e.g.
	 *            urn:epc:pat:sgtin-96:3.123.456.*
	 * @return A concrete implementation of Pattern capable of filtering
	 *         EPC-class specific tags.
	 * @throws PatternParseException
	 */
	public EPCPattern createEPCPattern(String uri) throws PatternParseException;

	/**
	 * return a concrete implementation of Pattern capable of filtering/
	 * grouping EPC class tags.
	 * 
	 * @param uri
	 *            A properly formatted EPC pattern. e.g.
	 *            urn:epc:pat:sgtin-96:3.123.456.*
	 * @param group
	 *            True if this pattern will be used for the grouping of tags.
	 * @return A concrete implementation of Pattern capable of filtering
	 *         EPC-class specific tags.
	 * @throws PatternParseException
	 */
	public EPCPattern createEPCPattern(String uri, boolean group)
			throws PatternParseException;

}
